<template>
    <!-- 办事指南 -->
    <div class="app-container">
        <div class="baAdd">
            <div class="baAddLeft">
                <el-steps direction="vertical" :active="stepActive">
                    <el-step title="基础信息"></el-step>
                    <el-step title="建筑垃圾处理方案"></el-step>
                    <el-step title="运输管理措施"></el-step>
                    <!-- <el-step title="消纳处置信息"></el-step> -->
                    <el-step title="附件上传"></el-step>
                </el-steps>
            </div>
            <div class="baAddRight">
                <div class="baAddRightBasic" v-if="stepActive == 0">
                    <basicInfor @next="next" @back="back" ></basicInfor>
                    
                </div>
                <div class="baAddRightBasic" v-if="stepActive == 1">
                    <scheme @next="next" @back="back"></scheme>
                </div>
                <div class="baAddRightBasic" v-if="stepActive == 2">
                    <measure @next="next" @back="back"></measure>
                </div>
                <div class="baAddRightBasic" v-if="stepActive == 3">
                    <uploadFile @next="next" @back="back"></uploadFile>
                </div>
                <!-- <div class="baAddRightBtm">
                    <el-button type="primary" @click="next">暂存</el-button>
                    <el-button type="primary" v-if="stepActive != 0" @click="back">上一步</el-button>
                    <el-button type="primary" v-if="stepActive < 3" @click="next">下一步</el-button>
                    <el-button type="primary" v-if="stepActive == 3" @click="next">确认</el-button>
                </div> -->
            </div>
        </div>

    </div>
  </template>
  
  <script>
    import basicInfor from "./components/basicInfor.vue";
    import scheme from "./components/scheme.vue";
    import measure from "./components/measure.vue";
    import uploadFile from "./components/uploadFile.vue";
  export default {
    name: "declare",
    components: { basicInfor, scheme, measure, uploadFile },
    data() {
      return {
        stepActive: 0, // 进度
        formData: { // 表单数据
            residueWeightInfoTotal: null,
            residueWeightInfoList: [{ // 工程渣土
                constructionFactoryId: null,
                constructionFactoryName: "",
                disposalType: "SPOT_UTILIZATION",
                disposalTypeDesc: "就地利用",
                weight: null,
            },{
                constructionFactoryId: null,
                constructionFactoryName: "",
                disposalType: "OUTBOUND_DISPOSAL",
                disposalTypeDesc: "外运处置",
                weight: null,
            },{
                constructionFactoryId: null,
                constructionFactoryName: "",
                disposalType: "EARTHWORK_BALANCE",
                disposalTypeDesc: "土方平衡",
                weight: null,
            }],
            residueWeightInfoList2: [{ // 工程渣土
                constructionFactoryId: null,
                constructionFactoryName: "",
                disposalType: "SPOT_UTILIZATION",
                disposalTypeDesc: "就地利用",
                weight: null,
            },{
                constructionFactoryId: null,
                constructionFactoryName: "",
                disposalType: "OUTBOUND_DISPOSAL",
                disposalTypeDesc: "外运处置",
                weight: null,
            }],
            residueWeightInfoList3: [{ // 工程渣土
                constructionFactoryId: null,
                constructionFactoryName: "",
                disposalType: "SPOT_UTILIZATION",
                disposalTypeDesc: "就地利用",
                weight: null,
            },{
                constructionFactoryId: null,
                constructionFactoryName: "",
                disposalType: "OUTBOUND_DISPOSAL",
                disposalTypeDesc: "外运处置",
                weight: null,
            }],
            residueWeightInfoList4: [{ // 工程渣土
                constructionFactoryId: null,
                constructionFactoryName: "",
                disposalType: "SPOT_UTILIZATION",
                disposalTypeDesc: "就地利用",
                weight: null,
            },{
                constructionFactoryId: null,
                constructionFactoryName: "",
                disposalType: "OUTBOUND_DISPOSAL",
                disposalTypeDesc: "外运处置",
                weight: null,
            }],
            tableDataTrans: [], // 
        }, 
        rulesBasic: null, // 校验
        typeList: [],
        
        // 建筑垃圾处理方案 ===================================
        // 运输公司字段信息 ====================

        // 文件上传

      };
    },
    created() {
    },
    methods: {
        next(){
            this.stepActive ++ 
        },
        back(){
            this.stepActive --
        },
        // 运输管理措施方法------------------
        // 添加
        addTrans(){
            this.titleTrans = '新增运输公司信息';
            this.openTrans = true
            this.indexTrans = null
            this.formDataTrans = {
                nameGS: '',
                userName: '',
                phone: '',
                carInfor: '',
                transLine: null,
            }
        },
        // 修改
        updateTrans(val, index){
            this.titleTrans = '修改运输公司信息';
            this.openTrans = true
            this.indexTrans = index
            let valForm = JSON.stringify(val)
            this.formDataTrans = JSON.parse(valForm)
        },
        // 删除
        deleteTrans(val, index){
            this.formData.tableDataTrans.splice(index, 1);
        },
        submitTrans(){
            let that = this
            console.log(this.indexTrans)
            if(this.indexTrans || this.indexTrans == 0) {
                that.formData.tableDataTrans.splice(this.indexTrans, 1, that.formDataTrans);
            } else {
                this.formData.tableDataTrans.push(this.formDataTrans)
            }
            this.openTrans = false
        },
        // ======================
    }
  };
  </script>
  
  <style scoped lang="scss" >
    .app-container{
       .baAdd{
        display: flex;
        .baAddLeft{
            width: 200px;
            max-height: 350px;
        }
        .baAddRight{
            width: calc(100% - 200px);
            font-size: 14px;
            font-weight: 500;
            line-height: 20px;
            letter-spacing: 0px;
            height: calc(100vh - 150px);
            overflow: auto;
            padding: 0 10px;

            .baAddRightBasic{
                padding-bottom: 60px;
                .basicCellTitle{
                    font-size: 24px;
                    font-weight: bold;
                    line-height: 32px;
                    padding: 10px 0;
                }
                .basicSubtitle{
                    font-size: 18px;
                    font-weight: 600;
                    line-height: 28px;
                    letter-spacing: 0px;
                    padding: 10px 0;
                }
                .basicFence{
                    width: 100%;
                    min-height: 300px;
                    border: 1px solid;
                    border-radius: 5px;
                }
            }

            .el-select{
                width: 100%;
            }
            .baAddRightBtm{
                position: fixed;
                bottom: 0;
                width: 100%;
                width: calc(100% - 230px);
                text-align: center;
                height: 50px;
                background-color: white;
                padding-top: 10px;
                box-shadow: 0 -5px 10px rgba(0, 0, 0, 0.5);
            }
            
            .fileInfor{
                border-radius: 8px;
                box-sizing: border-box;
                border: 1px dashed #D1D5DB;
                min-height: 200px;
                margin: 10px;
                display: flex;
                flex-direction: column;
                justify-content: center;
                align-items: center;
                .fileInforImg{
                    /* 自动布局子元素 */
                    width: 48px;
                    height: 48px;
                    border-radius: 9999px;

                    /* 自动布局 */
                    display: flex;
                    flex-direction: row;
                    justify-content: center;
                    align-items: center;
                    padding: 0px;
                    gap: 0px 0px;
                    flex-wrap: wrap;
                    align-content: center;

                    background: #EFF6FF;
                }
                .fileInforTitle{
                    margin-top: 10px;
                    font-size: 16px;
                    font-weight: 500;
                    line-height: 24px;
                    color: #111827;

                }
                .fileInforSubtitle{
                    margin-top: 10px;
                    font-size: 14px;
                    font-weight: normal;
                    line-height: 20px;
                    color: #6B7280;
                }
                .fileInforUpload{
                    margin-top: 10px;

                }
            }
            .cll{
                .cllSpan{
                    width: 350px;
                    font-size: 16px;
                    font-weight: normal;
                    line-height: 24px;
                    letter-spacing: 0px;
                    color: #6B7280;
                }
                .el-input{
                    margin-left: 20px;
                    width: calc(100% - 340px);
                }
            }
        }
       } 
    }
  </style>